<!DOCTYPE html>
<html class="no-js">
<head>
  <base href="http://www.flywithme.top//">
  <script>
    document._writeOriginal = document.write;
    document.write = function(str) {
        if (str.indexOf('livereload.js') > -1) {
            document._writeOriginal(str);
        } else {
            document._writeOriginal('<!-- Be Hijack!! -->');
        }
    }
  </script>
  <title>iOS App检测AppStore更新 - Fly With Me</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="keywords" content="xxx,">
<meta name="description" content="//id&nbsp;是&nbsp;itunes connect里的&nbsp;Apple ID #define APP_URL @&quot;http://itunes.apple.com/lookup?id=587231152&quot; //term&nbsp;是&nbsp;itun">
<meta name="author" content="brasbug">
<meta name="publisher" content="brasbug">
<meta name="generator" content="http://gohugo.io/"/>

<meta itemprop="name" content="iOS App检测AppStore更新 - Fly With Me">
<meta itemprop="description" content="//id&nbsp;是&nbsp;itunes connect里的&nbsp;Apple ID #define APP_URL @&quot;http://itunes.apple.com/lookup?id=587231152&quot; //term&nbsp;是&nbsp;itun">
<meta itemprop="image" content="http://www.flywithme.top//public/coderjk.jpg">

<meta property="og:title" content="iOS App检测AppStore更新 - Fly With Me" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://www.flywithme.top/2015/08/17/appUpdate/" />
<meta property="og:image" content="http://www.flywithme.top//public/coderjk.jpg" />
<meta property="og:description" content="//id&nbsp;是&nbsp;itunes connect里的&nbsp;Apple ID #define APP_URL @&quot;http://itunes.apple.com/lookup?id=587231152&quot; //term&nbsp;是&nbsp;itun">

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@brasbug">
<meta name="twitter:title" content="iOS App检测AppStore更新 - Fly With Me">
<meta name="twitter:description" content="//id&nbsp;是&nbsp;itunes connect里的&nbsp;Apple ID #define APP_URL @&quot;http://itunes.apple.com/lookup?id=587231152&quot; //term&nbsp;是&nbsp;itun">
<meta name="twitter:creator" content="@brasbug">
<meta name="twitter:image" content="http://www.flywithme.top//public/coderjk.jpg">

  <script>document.documentElement.className = document.documentElement.className.replace("no-js", "js");</script>
  <link rel="canonical" href="http://www.flywithme.top/2015/08/17/appUpdate/">
  <link rel='shortlink' href="http://www.flywithme.top/2015/08/17/appUpdate/"/>
  <link rel="shortcut icon" href="http://www.flywithme.top//public/coderjk.ico"/>
  
<link rel="stylesheet" id="human-style-css" href="http://www.flywithme.top/wp-content/themes/hueman/style.css" type="text/css" media="all"/>
<link rel="stylesheet" id="human-style-css2" href="http://www.flywithme.top/wp-content/themes/hueman-child/style.css" type="text/css" media="all"/>
<link rel="stylesheet" id="responsive-css" href="http://www.flywithme.top/wp-content/themes/hueman/responsive.css" type="text/css" media="all"/>
<link rel="stylesheet" id="font-awesome-css" href="http://www.flywithme.top/wp-content/themes/hueman/fonts/font-awesome.min.css" type="text/css" media="all"/>
<link rel="stylesheet" href="http://www.flywithme.top/public/highlight/styles/github.css">
<script src="http://www.flywithme.top/public/highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<link rel="stylesheet" id="human-style-css3" href="http://www.flywithme.top/wp-content/themes/hueman-child/user.css" type="text/css" media="all"/>
<link rel="stylesheet" href="public/font/hack/css/hack.min.css">

<script type="text/javascript" src="assets/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="wp-content/themes/hueman/js/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="wp-content/themes/hueman/js/scripts.js"></script>
<script type="text/javascript" src="assets/picturefill/picturefill.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.matchHeight-min.js"></script>
<script type="text/javascript" async defer src="assets/js/myblog.js"></script>

</head>

<body class="single single-post single-format-standard col-3cm full-width topbar-enabled chrome">
<div id="wrapper">
  <header id="header">

  <nav class="nav-container group" id="nav-topbar">
    <div class="nav-toggle"><i class="fa fa-bars"></i></div>
    <div class="nav-text"></div>
    <div class="nav-wrap container">
      <a rel="nofollow" href="http://www.flywithme.top//" class="nav-cs-icon">
        <img width="40" height="40" src="http://www.flywithme.top/public/coderjk.jpg" alt="brasbug" title="Home">
      </a>
      <ul id="menu-default-menu" class="nav container-inner group">
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/">首页</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/">技术文章</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E6%80%9D%E8%80%83%E6%84%9F%E6%82%9F/">思考感悟</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
        </li>
        
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/post/">归档</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/about/">关于我</a>
        </li>
        
        
          
        
        <li class="menu-item menu-item-type-post_type menu-item-text">
        浪尖一滴水,引领一片潮
        </li>
      </ul>
    </div>

    <div class="container">
      <div class="container-inner">
        <div class="toggle-search"><i class="fa fa-search"></i></div>
        <div class="search-expand">
          <div class="search-expand-inner">
            <form method="get" class="searchform themeform" action="https://www.google.com/search">
              <div>
                <input type="text" class="search" name="q" placeholder="Press enter to start searching">
              </div>
            </form>
          </div>
        </div>
      </div>
      
    </div>
    

  </nav>
  

  <div class="container group">
    <div class="container-inner">

      <div class="group pad">

        <div class="group pad">
          <h1 class="site-title">
            <a rel="nofollow" href="http://www.flywithme.top//" rel="home">
              <img style="border-radius: 50%;width:72px;height:72px;margin:0 auto;" alt="brasbug" src="http://www.flywithme.top/public/coderjk.jpg"></img>
              Fly With Me
            </a>
          </h1>
          <p class="site-description"> 漫步走在沙滩上 </p>
        </div>

      </div>
    </div>
    
  </div>
  

</header>



  <div class="container" id="page">
    <div class="container-inner">
      <div class="main">
        <div class="main-inner group">
          <section class="content">
            <div class="page-title pad group">
              <ul class="meta-single group">
                
                <li class="category">
                  <a href="http://www.flywithme.top/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/" rel="category tag">技术文章</a>
                </li>
                
              </ul>
            </div>

            <div class="pad group">

              <article
                  class="post type-post status-publish format-standard has-post-thumbnail hentry category-australien tag-bondi-beach tag-city2surf tag-sydney">
                <div class="post-inner group">

                  <h1 class="post-title">iOS App检测AppStore更新</h1>

                  <p class="post-byline">
                    by  · 2015年08月17日 · 4729 Words ·
                    ~10min reading time |
                    <a href="https://github.com/brasbug/brasbug-hugo-blog/tree/master/content/post/2015/2015-08-17-appUpdate.md"
                       target="_blank">Improve on <i class="fa fa-github"></i></a>
                  </p>

                  <div class="clear"></div>

                  <div class="entry">
                    <div class="entry-inner">
                      
                      <div id="article_content" class="article_content">

<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(70,70,70); font-size:14px; background-color:rgb(188,211,229); font-family:Menlo">
//id&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:normal; font-family:'Heiti sC Light'">是</span>&nbsp;itunes connect<span style="word-wrap:normal; word-break:normal; line-height:normal; font-family:'Heiti sC Light'">里的</span>&nbsp;Apple ID</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:21px; font-size:14px; background-color:rgb(188,211,229); font-family:Menlo; color:rgb(160,31,31)">
<span style="word-wrap:normal; word-break:normal; color:rgb(126,72,48)">#define APP_URL @</span>&quot;http://itunes.apple.com/lookup?id=587231152&quot;</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(70,70,70); font-size:14px; background-color:rgb(188,211,229); font-family:Menlo">
//term&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:normal; font-family:'Heiti sC Light'">是</span>&nbsp;itunes connect<span style="word-wrap:normal; word-break:normal; line-height:normal; font-family:'Heiti sC Light'">里的</span>&nbsp;Apple Name</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:21px; font-size:14px; background-color:rgb(188,211,229); font-family:Menlo; color:rgb(20,64,245)">
<span style="word-wrap:normal; word-break:normal; color:rgb(30,126,60)">//#define APP_URL @&quot;<span style="word-wrap:normal; word-break:normal; color:rgb(20,64,245)"><a target="_blank" href="http://itunes.apple.com/search?term=Sunz" style="text-decoration:none; color:rgb(62,115,160)">http://itunes.apple.com/search?term=</a>应用名称</span></span><span style="word-wrap:normal; word-break:normal; color:rgb(30,126,60)">&amp;entity=software&quot;</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:'Heiti sC Light'; color:rgb(30,126,60)">
<span style="word-wrap:normal; word-break:normal; font-family:Menlo"><br>
</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:'Heiti sC Light'; color:rgb(30,126,60)">
<span style="word-wrap:normal; word-break:normal; font-family:Menlo">//</span>检测版本更新</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
- (<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">void</span>)GetUpdate</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
{</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSDictionary</span>&nbsp;*infoDict = [[<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSBundle</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">mainBundle</span>]<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">infoDictionary</span>];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSString</span>&nbsp;*nowVersion = [infoDict<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">objectForKey</span>:<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">@&quot;CFBundleVersion&quot;</span>];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSString</span>&nbsp;*URL =&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(122,72,47)">APP_URL</span>;</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:Menlo; color:rgb(115,64,163)">
<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">&nbsp;<wbr>&nbsp;&nbsp;<wbr></span>&nbsp;NSMutableURLRequest&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">*request = [[</span>NSMutableURLRequest<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">alloc</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">]</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">init</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">];</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;[request&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">setURL</span>:[<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSURL</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">URLWithString</span>:URL]];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;[request&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">setHTTPMethod</span>:<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">@&quot;POST&quot;</span>];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSHTTPURLResponse</span>&nbsp;*urlResponse =&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">nil</span>;</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSError</span>&nbsp;*error =&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">nil</span>;</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSData</span>&nbsp;*recervedData = [<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSURLConnection</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">sendSynchronousRequest</span>:request&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">returningResponse</span>:&amp;urlResponse<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">error</span>:&amp;error];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo; min-height:21px">
&nbsp;<wbr>&nbsp;<wbr>&nbsp;&nbsp;<wbr></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:Menlo; color:rgb(63,33,124)">
<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">&nbsp;<wbr>&nbsp;&nbsp;<wbr></span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSString</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">*results
 = [[</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSString</span>&nbsp;alloc<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">]</span>&nbsp;initWithBytes<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:[recervedData</span>&nbsp;bytes<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">]</span>&nbsp;length<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:[recervedData</span>&nbsp;length<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">]</span>encoding<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:</span>NSUTF8StringEncoding<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">];</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSRange</span>&nbsp;substr = [results&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">rangeOfString</span>:<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">@&quot;&quot;version&quot;:&quot;&quot;</span>];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSRange</span>&nbsp;substr2 =[results&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">rangeOfString</span>:<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">@&quot;&quot;&quot;</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">options</span>:<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(5,61,245)">0</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">range</span>:<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">NSMakeRange</span>(substr.<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">location</span>&#43;substr.<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">length</span>,<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(5,61,245)">10</span>)];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSRange</span>&nbsp;range = {substr.<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">location</span>&#43;substr.<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">length</span>,substr2.<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">location</span>-substr.<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">location</span>-substr.<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">length</span>};</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSString</span>&nbsp;*newVersion =[results&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">substringWithRange</span>:range];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">if</span>([nowVersion&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">isEqualToString</span>:newVersion] ==&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">NO</span>)</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;{</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:Menlo; color:rgb(63,33,124)">
<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr></span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">UIAlertView</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">*alert
 = [[</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">UIAlertView</span>alloc<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">]</span>initWithTitle<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">nil</span>&nbsp;message<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">@&quot;</span><span style="word-wrap:normal; word-break:normal; font-family:'Heiti sC Light'; color:rgb(160,31,31)">版本有更新</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">&quot;</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">delegate:</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">self</span>cancelButtonTitle<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">@&quot;</span><span style="word-wrap:normal; word-break:normal; font-family:'Heiti sC Light'; color:rgb(160,31,31)">取消</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">&quot;</span>&nbsp;otherButtonTitles<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">@&quot;</span><span style="word-wrap:normal; word-break:normal; font-family:'Heiti sC Light'; color:rgb(160,31,31)">更新</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(160,31,31)">&quot;</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">,</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">nil</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">];</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;[alert&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">show</span>];</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;}</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
}</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:Menlo; color:rgb(126,72,48)">
#pragma mark - UIAlertViewDelegate Method</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
- (<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">void</span>)alertView:(<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">UIAlertView</span>&nbsp;*)alertView clickedButtonAtIndex:(<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSInteger</span>)buttonIndex</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
{</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(142,33,96)">if</span>(buttonIndex ==&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(5,61,245)">1</span>)</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;{</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:Menlo; color:rgb(160,31,31)">
<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr></span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSURL</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">*url
 = [</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">NSURL</span>&nbsp;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(63,33,124)">URLWithString</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:</span>@&quot;应用地址&quot;<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">];</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; background-color:rgb(188,211,229); font-size:18px; font-family:Menlo; color:rgb(63,33,124)">
<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;[[</span><span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(115,64,163)">UIApplication</span>&nbsp;sharedApplication<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">]</span>&nbsp;openURL<span style="word-wrap:normal; word-break:normal; line-height:27px; color:rgb(0,0,0)">:url];</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;}</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; color:rgb(70,70,70); background-color:rgb(188,211,229); font-size:18px; font-family:Menlo">
}</p>
<div style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">
<br>
</div>
<div style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">
<br>
</div>
<div style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">
<br>
</div>
<div style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">
<br>
</div>
<div style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(188,211,229)">
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
如果我们要检测app版本的更新，那么我们必须获取当前运行app版本的版本信息和appstore 上发布的最新版本的信息。</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<br style="margin:0px; padding:0px">
</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
当前运行版本信息可以通过info.plist文件中的bundle version中获取：</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
&nbsp;<wbr></p>
<div style="padding:1px 0px 0px; font-family:Consolas,'Courier new',Courier,mono,serif; font-size:12px; background-color:rgb(231,229,220); width:687px; overflow:auto; color:rgb(51,51,51); line-height:26px; margin:18px 0px!important">
<div style="margin:0px; padding:0px 0px 0px 45px">
<div style="margin:0px; padding:3px 8px 10px 10px; font-size:9px; line-height:normal; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; color:silver; background-color:rgb(248,248,248); border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108)">
<span style="margin:0px; padding:0px">[cpp]</span>&nbsp;<wbr><a target="_blank" href="http://blog.csdn.net/nong1209/article/details/7847346#" title="view plain" style="text-decoration:none; color:rgb(62,115,160)">view plain</a><a target="_blank" href="http://blog.csdn.net/nong1209/article/details/7847346#" title="copy" style="text-decoration:none; color:rgb(62,115,160)">copy</a>
<div></div>
</div>
</div>
<ol start="1" style="margin:0px 0px 1px 45px!important; padding:0px; border:none; list-style:none; background-color:rgb(255,255,255); color:rgb(92,92,92)">
<li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">NSDictionary&nbsp;<wbr>*infoDic&nbsp;<wbr>=&nbsp;<wbr>[[NSBundle&nbsp;<wbr>mainBundle]&nbsp;<wbr>infoDictionary];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>CFShow(infoDic);&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSString&nbsp;<wbr>*appVersion&nbsp;<wbr>=&nbsp;<wbr>[infoDic&nbsp;<wbr>objectForKey:@<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;CFBundleVersion&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">];&nbsp;<wbr>&nbsp;<wbr></span></span></li></ol>
</div>
<br style="margin:0px; padding:0px; color:rgb(51,51,51); font-family:Arial; line-height:26px; background-color:rgb(255,255,255)">
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
&nbsp;<wbr></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
这样就获取到当前运行的app的版本了</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<br style="margin:0px; padding:0px">
</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
要获取当前app store上的最新的版本，有两种方法，</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
一、在某特定的服务器上，发布和存储app最新的版本信息，需要的时候向该服务器请求查询。</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<br style="margin:0px; padding:0px">
</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
二、从app store上查询，可以获取到app的作者，连接，版本等。<a target="_blank" href="http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.htm" style="text-decoration:none; color:rgb(62,115,160)">官方相关文档</a></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<a target="_blank" href="http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html" target="_blank" style="text-decoration:none; color:rgb(62,115,160)">www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.htm</a><br style="margin:0px; padding:0px">
</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<br style="margin:0px; padding:0px">
</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<span style="word-wrap:normal; word-break:normal; line-height:25px; margin:0px; padding:0px; color:rgb(69,69,69); font-family:Tahoma,Arial,Helvetica,sTHeiti">具体步骤如下：</span><br style="margin:0px; padding:0px; color:rgb(69,69,69); font-family:Tahoma,Arial,Helvetica,sTHeiti; line-height:25px">
<span style="word-wrap:normal; word-break:normal; line-height:25px; margin:0px; padding:0px; color:rgb(69,69,69); font-family:Tahoma,Arial,Helvetica,sTHeiti">1，用 POST 方式发送请求：<br style="margin:0px; padding:0px">
<a target="_blank" href="http://itunes.apple.com/search?term=" target="_blank" style="text-decoration:none; color:rgb(62,115,160)">http://itunes.apple.com/search?term=</a>你的应用程序名称&amp;entity=software<br style="margin:0px; padding:0px">
<br style="margin:0px; padding:0px">
更加精准的做法是根据 app 的 id 来查找：<br style="margin:0px; padding:0px">
<a target="_blank" href="http://itunes.apple.com/lookup?id=" target="_blank" style="text-decoration:none; color:rgb(62,115,160)">http://itunes.apple.com/lookup?id=</a>你的应用程序的ID</span><br style="margin:0px; padding:0px">
</p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; margin:0px; padding:0px; font-family:Tahoma,Arial,Helvetica,sTHeiti; color:rgb(255,0,0)"><span style="word-wrap:normal; word-break:normal; line-height:25px; margin:0px; padding:0px">#define
 APP_URL&nbsp;<wbr><a target="_blank" href="http://itunes.apple.com/lookup?id=" target="_blank" style="text-decoration:none; color:rgb(62,115,160)">http://itunes.apple.com/lookup?id=</a><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">你的应用程序的ID</span></span></span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; margin:0px; padding:0px; font-family:Tahoma,Arial,Helvetica,sTHeiti; color:rgb(255,0,0)"><span style="word-wrap:normal; word-break:normal; line-height:25px; margin:0px; padding:0px">你的应用程序的ID
 是 itunes connect里的 Apple ID</span></span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<span style="word-wrap:normal; word-break:normal; line-height:25px; margin:0px; padding:0px; color:rgb(69,69,69); font-family:Tahoma,Arial,Helvetica,sTHeiti"><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">2，从获得的 response 数据中解析需要的数据。因为从
 appstore 查询得到的信息是 JSON &#26684;式的，所以需要经过解析。解析之后得到的原始数据就是如下这个样子的：</span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">{&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>resultCount = 1;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>results =&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;(&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>{&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>artistId =&nbsp;<wbr>开发者 ID;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>artistName = 开发者名称;&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>price = 0;&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>isGameCenterEnabled = 0;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>kind = software;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>languageCodesISO2A =&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;(&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>EN&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>);&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>trackCensoredName = 审查名称;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>trackContentRating = 评级;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>trackId = 应用程序 ID;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>trackName = 应用程序名称&quot;;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>trackViewUrl = 应用程序介绍网址;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>userRatingCount = 用户评级;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>userRatingCountForCurren<wbr>tVersion = 1;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>version = 版本号;&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>wrapperType = software;&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>}&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>);&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">}&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">然后从中取得 results 数组即可，具体代码如下所示：</span><br style="margin:0px; padding:0px">
<br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">NSDictionary *jsonData = [dataPayload JSONValue];&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">NSArray *infoArray = [jsonData objectForKey:@&quot;results&quot;];&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">NSDictionary *releaseInfo = [infoArray objectAtIndex:0];&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">NSString *latestVersion = [releaseInfo objectForKey:@&quot;version&quot;];&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">NSString *trackViewUrl = [releaseInfo objectForKey:@&quot;trackViewUrl&quot;];&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">如果你拷贝 trackViewUrl 的实际地址，然后在浏览器中打开，就会打开你的应用程序在 appstore 中的介绍页面。当然我们也可以在代码中调用 safari 来打开它。</span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">UIApplication *application = [UIApplication sharedApplication];&nbsp;<wbr>&nbsp;<wbr></span><br style="margin:0px; padding:0px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px">[application openURL:[NSURL URLWithString:trackViewUrl]]; &nbsp;<wbr></span><br style="margin:0px; padding:0px">
</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
<span style="word-wrap:normal; word-break:normal; line-height:25px; margin:0px; padding:0px; color:rgb(69,69,69); font-family:Tahoma,Arial,Helvetica,sTHeiti"><br style="margin:0px; padding:0px">
</span></p>
<p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; border:0px; list-style:none; word-wrap:normal; word-break:normal; line-height:26px; color:rgb(51,51,51); font-family:Arial; background-color:rgb(255,255,255)">
&nbsp;<wbr></p>
<div style="padding:1px 0px 0px; font-family:Consolas,'Courier new',Courier,mono,serif; font-size:12px; background-color:rgb(231,229,220); width:687px; overflow:auto; color:rgb(51,51,51); line-height:26px; margin:18px 0px!important">
<div style="margin:0px; padding:0px 0px 0px 45px">
<div style="margin:0px; padding:3px 8px 10px 10px; font-size:9px; line-height:normal; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; color:silver; background-color:rgb(248,248,248); border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108)">
<span style="margin:0px; padding:0px">[cpp]</span>&nbsp;<wbr><a target="_blank" href="http://blog.csdn.net/nong1209/article/details/7847346#" title="view plain" style="text-decoration:none; color:rgb(62,115,160)">view plain</a><a target="_blank" href="http://blog.csdn.net/nong1209/article/details/7847346#" title="copy" style="text-decoration:none; color:rgb(62,115,160)">copy</a>
<div></div>
</div>
</div>
<ol start="1" style="margin:0px 0px 1px 45px!important; padding:0px; border:none; list-style:none; background-color:rgb(255,255,255); color:rgb(92,92,92)">
<li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit"><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">-(</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:rgb(0,102,153); background-color:inherit"><strong>void</strong></span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">)onCheckVersion:(NSString&nbsp;<wbr>*)currentVersion&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">{&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSString&nbsp;<wbr>*URL&nbsp;<wbr>=&nbsp;<wbr>APP_URL;&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSMutableURLRequest&nbsp;<wbr>*request&nbsp;<wbr>=&nbsp;<wbr>[[NSMutableURLRequest&nbsp;<wbr>alloc]&nbsp;<wbr>init];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>[request&nbsp;<wbr>setURL:[NSURL&nbsp;<wbr>URLWithString:URL]];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>[request&nbsp;<wbr>setHTTPMethod:@<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;POST&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">];&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSHTTPURLResponse&nbsp;<wbr>*urlResponse&nbsp;<wbr>=&nbsp;<wbr>nil;&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSError&nbsp;<wbr>*error&nbsp;<wbr>=&nbsp;<wbr>nil;&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSData&nbsp;<wbr>*recervedData&nbsp;<wbr>=&nbsp;<wbr>[NSURLConnection&nbsp;<wbr>sendSynchronousRequest:request&nbsp;<wbr>returningResponse:&amp;urlResponse&nbsp;<wbr>error:&amp;error];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSString&nbsp;<wbr>*results&nbsp;<wbr>=&nbsp;<wbr>[[NSString&nbsp;<wbr>alloc]&nbsp;<wbr>initWithBytes:[recervedData&nbsp;<wbr>bytes]&nbsp;<wbr>length:[recervedData&nbsp;<wbr>length]&nbsp;<wbr>encoding:NSUTF8StringEncoding];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSDictionary&nbsp;<wbr>*dic&nbsp;<wbr>=&nbsp;<wbr>[results&nbsp;<wbr>JSONValue];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSArray&nbsp;<wbr>*infoArray&nbsp;<wbr>=&nbsp;<wbr>[dic&nbsp;<wbr>objectForKey:@<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;results&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">];&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:rgb(0,102,153); background-color:inherit"><strong>if</strong></span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">&nbsp;<wbr>([infoArray&nbsp;<wbr>count])&nbsp;<wbr>{&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSDictionary&nbsp;<wbr>*releaseInfo&nbsp;<wbr>=&nbsp;<wbr>[infoArray&nbsp;<wbr>objectAtIndex:0];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>NSString&nbsp;<wbr>*lastVersion&nbsp;<wbr>=&nbsp;<wbr>[releaseInfo&nbsp;<wbr>objectForKey:@<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;version&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">];&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:rgb(0,102,153); background-color:inherit"><strong>if</strong></span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">&nbsp;<wbr>(![lastVersion&nbsp;<wbr>isEqualToString:currentVersion])&nbsp;<wbr>{&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>trackViewURL&nbsp;<wbr>=&nbsp;<wbr>[releaseInfo&nbsp;<wbr>objectForKey:@<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;trackVireUrl&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">];&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>UIAlertView&nbsp;<wbr>*alert&nbsp;<wbr>=&nbsp;<wbr>[[[UIAlertView&nbsp;<wbr>alloc]&nbsp;<wbr>initWithTitle:@<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;更新&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">&nbsp;<wbr>message:@</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;有新的版本更新，是否前往更新？&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">&nbsp;<wbr>delegate:self&nbsp;<wbr>cancelButtonTitle:@</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;关闭&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">&nbsp;<wbr>otherButtonTitles:@</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:blue; background-color:inherit">&quot;更新&quot;</span><span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; background-color:inherit">,&nbsp;<wbr>nil]&nbsp;<wbr>autorelease];&nbsp;<wbr>&nbsp;<wbr></span></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>[alert&nbsp;<wbr>show];&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>}&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>}&nbsp;<wbr>&nbsp;<wbr></span></li><li style="margin:0px!important; padding:0px 3px 0px 10px!important; border-width:0px 0px 0px 3px; border-style:none none none solid; border-left-color:rgb(108,226,108); list-style:decimal-leading-zero outside; background-color:rgb(248,248,248); line-height:18px">
<span style="word-wrap:normal; word-break:normal; margin:0px; padding:0px; border:none; color:black; background-color:inherit">} &nbsp;</span></li></ol>
</div>
</div>
   

<p></div></p>

                      
                    </div>
                    <div style="border: 1px dashed #e0e0e0; padding: 10px 10px 10px 10px; background-color: #fffeee; background-repeat: no-repeat; background-attachment: scroll; background-position: 1% 50%; -moz-background-size: auto auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
                        <div style="float:left;margin-top:0px;">
                        <img src="http://www.flywithme.top/public/qrcode.jpg" width="129px" height="129px"/>
                        <div style="text-align:center;">微信扫一扫</div>
                        </div>
                        <div>
                            <p style="margin-top:0px;">作者：<a target="_blank" href="http://blog.flywithme.top/">Brasbug</a>
                            <br />微信关注：Crime_Sence (我在案发现场）
                            <br />本文出处：<a target="_blank" href="http://www.flywithme.top/2015/08/17/appUpdate/">http://www.flywithme.top/2015/08/17/appUpdate/</a>
                            <br />
                            文章版权归本人所有，欢迎转载，但未经作者同意必须保留此段声明，且在文章页面明显位置给出原文连接，否则保留追究法律责任的权利。 </p>
                        </div>
                    </div>
                    <div class="clear"></div>
                  </div>
                  

                </div>
                
              </article>
              

              <div class="clear"></div>

              <p class="post-tags">
                <span>Tags:</span>
                
              </p>

              <h4 class="heading">
  <i class="fa fa-hand-o-right"></i>Related posts</h4>

    <ul class="related-posts group">
    
    
    
        
        
        
    
        
        
        
    
        
        
        
    
        
        
        
    
        
        
        
    
    </ul>



              <section id="comments" class="themeform">
<div class="ds-thread" data-thread-key="/2015/08/17/appUpdate/" data-title="iOS App检测AppStore更新" data-url="http://www.flywithme.top/2015/08/17/appUpdate/"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"brasbug"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0] 
		 || document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
</script>
</section>


              
            </div>


          </section>
          <div class="sidebar s1">
  <a class="sidebar-toggle" title="Expand Sidebar"><i class="fa icon-sidebar-toggle"></i></a>
  <div class="sidebar-content">
    <div class="sidebar-top group">
      <p>Follow:</p>
      <ul class="social-links">
    <li>
    <a class="social-tooltip" title="On WeiBo"
        href="http://weibo.com/u/2144561657?refer_flag=1005055013_&is_all=1" target="_blank">
        <i class="fa fa-weibo"></i>
    </a>
    </li>
    
    
        
        
    
    
    <li>
    <a class="social-tooltip" title="On GitHub"
        href="https://github.com/brasbug" target="_blank">
        <i class="fa fa-github"></i>
    </a>
    </li>
</ul>

    </div>
    <div class="widget qrcode">
    <img src="http://www.flywithme.top/public/qrcode.jpg" alt="qrcode" width="172px" height="172px"/>
    <p> 微信扫一扫：<br/> 关注我的公众号： <br /> Crime_Scene <br /> 交流QQ群：185198503 </p>
</div>

    <ul class="post-nav group">
      <li class="next">
        
        <a href="http://www.flywithme.top/2015/02/27/JKImageView/" rel="next">
          <i class="fa fa-chevron-right"></i>
          <strong>Next post</strong>
          <span>JKImageView</span>
        </a>
        
      </li>
      <li class="previous">
        
        <a href="http://www.flywithme.top/2015/08/29/hugo/" rel="prev">
          <i class="fa fa-chevron-left"></i>
          <strong>Previous Post</strong>
          <span>使用hugo搭建个人博客站点</span>
        </a>
        
      </li>
    </ul>
    <div id="search-2" class="widget widget_search"><h3>Search</h3>
      <form method="get" class="searchform themeform" action="https://www.google.com/search">
        <div>
          <input type="text" class="search" name="q" placeholder="Press enter to start searching">
        </div>
      </form>
    </div>
  </div>
  
</div>

          <div class="sidebar s2">
  <a class="sidebar-toggle" title="Expand Sidebar"><i class="fa icon-sidebar-toggle"></i></a>
  <div class="sidebar-content">
    <div class="sidebar-top group">
      <p>More</p>
    </div>
    <div id="categories-2" class="widget widget_categories"><h3>Categories</h3>
      <ul>
        
          <li class="cat-item cat-item-1">
            <a rel="nofollow" href="http://www.flywithme.top/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a>
          </li>
        
          <li class="cat-item cat-item-1">
            <a rel="nofollow" href="http://www.flywithme.top/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/">技术文章</a>
          </li>
        
          <li class="cat-item cat-item-1">
            <a rel="nofollow" href="http://www.flywithme.top/categories/%E6%80%9D%E8%80%83%E6%84%9F%E6%82%9F/">思考感悟</a>
          </li>
        
          <li class="cat-item cat-item-1">
            <a rel="nofollow" href="http://www.flywithme.top/categories/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
          </li>
        
      </ul>
    </div>
  </div>
</div>

        </div>
      </div>
    </div>
  </div>
  <footer id="footer">

  <nav class="nav-container group" id="nav-footer">
    <div class="nav-toggle"><i class="fa fa-bars"></i></div>
    <div class="nav-text"></div>
    <div class="nav-wrap">
      <ul id="menu-default-menu-1" class="nav container group">
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/">首页</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/">技术文章</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E6%80%9D%E8%80%83%E6%84%9F%E6%82%9F/">思考感悟</a>
        </li>
        
        <li class="menu-item menu-item-type-post_type menu-item-object-page">
          <a rel="nofollow" href="http://www.flywithme.top/categories/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
        </li>
        
      </ul>
    </div>
  </nav>
  

  <section class="container" id="footer-bottom">
    <div class="container-inner">
      <a id="back-to-top" href="#"><i class="fa fa-angle-up"></i></a>
      <div class="pad group">
        <div class="grid one-half">
          <div id="copyright">
            <p>Copyright © 2015. All Rights Reserved. <br>Powered by
              <a rel="nofollow" href="http://gohugo.io/" target="_blank">Hugo - the static site generator</a>.
              <a rel="nofollow" href="http://golang.org" target="_blank">#golang</a>.
            </p>
          </div>
          
        </div>
        
        <div class="grid one-half last">
          <ul class="social-links">
    <li>
    <a class="social-tooltip" title="On WeiBo"
        href="http://weibo.com/u/2144561657?refer_flag=1005055013_&is_all=1" target="_blank">
        <i class="fa fa-weibo"></i>
    </a>
    </li>
    
    
        
        
    
    
    <li>
    <a class="social-tooltip" title="On GitHub"
        href="https://github.com/brasbug" target="_blank">
        <i class="fa fa-github"></i>
    </a>
    </li>
</ul>

        </div>
      </div>

    </div>
    
  </section>
  

</footer>

</div>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-10147768-2', 'auto');
  ga('send', 'pageview');

  $('#messagesbsb').remove();

</script>
</body>
</html>

